package com.clx.common.domain.entity;


import com.alibaba.fastjson2.annotation.JSONField;
import lombok.Builder;
import lombok.Data;

import java.util.Date;

/**
 * 文件表
 *
 * @author clx
 * @since 2025-01-12 12:58:53
 */
@Data
@Builder
public class DiskFile extends BaseEntity {
    private static final long serialVersionUID = -53635222050409393L;

    public DiskFile() {
    }

    public DiskFile(Long id, Long userId, String fileName, String filePath, String fileMd5, Long fileSize, Long fileType, Long parentId, Long totalChunks, Long uploadedChunks, Integer status, Date createTime) {
        this.id = id;
        this.userId = userId;
        this.fileName = fileName;
        this.filePath = filePath;
        this.fileMd5 = fileMd5;
        this.fileSize = fileSize;
        this.fileType = fileType;
        this.parentId = parentId;
        this.totalChunks = totalChunks;
        this.uploadedChunks = uploadedChunks;
        this.status = status;
        this.createTime = createTime;
    }

    /**
     * 文件ID (主键)
     */
    private Long id;
    /**
     * 用户ID (逻辑外键)
     */
    private Long userId;
    /**
     * 文件名
     */
    private String fileName;
    /**
     * 文件存储路径
     */
    private String filePath;
    /**
     * 文件在redis的标识
     */
    private String fileMd5;
    /**
     * 文件大小
     */
    private Long fileSize;

    /**
     * 文件类型 0文件夹  1图片   2视频    3文档    4音频    5其他
     */
    private Long fileType;
    /**
     * 父级id
     */
    private Long parentId;


    /**
     * 总分块数
     */
    private Long totalChunks;
    /**
     * 已上传分块数
     */
    private Long uploadedChunks;
    /**
     * 文件上传状态，0未上传，1已经上传
     */
    private Integer status;
    /**
     * 创建时间
     */
    @JSONField(format = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX")
    private Date createTime;



}

